/*
 * app_debug.h
 *
 *  Created on: 2017-12-19
 *      Author: root
 */

#ifndef APP_DEBUG_H_
#define APP_DEBUG_H_


#ifdef __cplusplus

extern "C"{

#endif
#include "log.h"

#define TITLE_MAIN  "[MAIN]"
#define _DEBUG_    1    //临时显示  正在启动充电，但控制器超时
#if(_DEBUG_ == 1)
#define DEBUG_SHOW1(x,...) log_debug_new(TITLE_MAIN,"[MYSHOW]"#x"\n", ##__VA_ARGS__)
#else
#define DEBUG_SHOW1(x,...)
#endif

#define _TCU_MAIN_  0 //与TCU通信CAN口调试
#if(_TCU_MAIN_ == 1)
#define main_debug(x,...) log_debug_new(TITLE_MAIN,"[TCU]"#x"\n", ##__VA_ARGS__)
#else
#define main_debug(x,...)
#endif

#define _TCU_UI_  0   //与TCU通信CAN口调试
#if(_TCU_UI_ == 1)
#define ui_debug(x,...) log_debug_new(TITLE_MAIN,"[UI]"#x"\n", ##__VA_ARGS__)
#define ui_debug1(x,...) log_debug_new(TITLE_MAIN,"[UI]"#x"\n", ##__VA_ARGS__)
#else
#define ui_debug1(x,...)   //log_debug_new(TITLE_MAIN,"[UI]"#x"\n", ##__VA_ARGS__)
#define ui_debug(x,...)
#endif

#define _TCUCAN_  0 //与TCU通信CAN口调试
#if(_TCUCAN_ == 1)
#define can_debug(x,...) log_debug_new(TITLE_MAIN,"[TCUCAN]"#x"\n", ##__VA_ARGS__)//12345
#define can_debug1(x,...) log_debug_new(TITLE_MAIN,"[TCUCAN]"#x"\n", ##__VA_ARGS__)//12345
#else
#define can_debug1(x,...)
#define can_debug(x,...)
#endif

#define _DEBUG_METER_     1  //临时显示CANDLL
#if(_DEBUG_METER_ == 1)
#define debug_meter(x,...) log_debug_new(TITLE_MAIN,"[METER]"#x"\n", ##__VA_ARGS__)
#define debug_meter1(x,...) log_debug_new(TITLE_MAIN,"[METER]"#x"\n", ##__VA_ARGS__)
#else
#define debug_meter1(x,...)     //log_debug_new(TITLE_MAIN,"[METER]"#x"\n", ##__VA_ARGS__)
#define debug_meter(x,...)
#endif

#define _DEBUG_SOCK_   0  //临时显示CANDLL
//#define debug_sss(x,...) log_debug_new(TITLE_MAIN,#x, ##__VA_ARGS__)
#if(_DEBUG_SOCK_ == 1)
#define debug_sock(x,...) log_debug_new(TITLE_MAIN,"[SOCK]"#x"\n", ##__VA_ARGS__)
#else
#define debug_sock(x,...)
#endif
#define _DEBUG_104_   0  //临时显示
#if(_DEBUG_104_ == 1)
#define debug_104(x,...)   log_debug_new(TITLE_MAIN,"[104]"#x"\n", ##__VA_ARGS__)//
#else
#define debug_104(x,...)
#endif
//tcu_debug1

//#define fs_debug_sock(x,...) log_debug_fs("[SOCK]"#x"\n", ##__VA_ARGS__)


#ifdef __cplusplus

}

#endif

#endif /* APP_DEBUG_H_ */



//xj_start_charge_param* p = (xj_start_charge_param*)param;
//printf("start charge! gun_index:%d!\n",p->gun_index);
//printf("充电参数打印   g_chargepara_xj[p->gun_index].value=%d\n",(int)g_chargepara_xj[p->gun_index].value);
//printf("充电参数打印   流水号=%s  mode=%d\n",g_chargepara_xj[p->gun_index].serialnum,g_chargepara_xj[p->gun_index].billmode);
//printf("接收到主站发来的充电要求\r\n");
//printf("接收到主站发来的充电要求\r\n");
//xj_start_charge_result r;
//memset(&r,0,sizeof(xj_start_charge_result));
//if(gpnet_xj->startCharge(p->gun_index,(void*)&g_chargepara_xj[p->gun_index])!=0)//p->gun_index  p->gun_index
//{
//		    strncpy(r.err_no,"100d",XJ_MAX_ERR_NO_LEN-1);//此处的100d是指故障码，表示未插枪，用户需要根据实际故障码
//}
//else
//{
//
//		strncpy(r.err_no,"0",XJ_MAX_ERR_NO_LEN-1);
//}
//memcpy(result,&r,sizeof(xj_start_charge_result));
//
//printf("ssssssspppppppppppppsssssssss\r\n\r\n");
//return;



